<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Awesome UI</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/theme.css" rel="stylesheet">
    <link href="../css/animate.min.css" rel="stylesheet">
    <link href="../css/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/plugins/panel.css" rel="stylesheet"/>
    <link href="../css/plugins/form.css" rel="stylesheet"/>

    <!--[if lt IE 9]>
    <script src="../js/html5shiv.min.js"></script>
    <script src="../js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="dashboard-page sb-l-o sb-r-c onload-check">
	<!-- Start: Header -->
    <?php include 'common_header.php';?>
    <!-- End: Header -->
    
    <!-- Start: Header -->
    <?php include 'common_sidebar.php';?>
    <!-- End: Header -->
    
    <!-- Start: Content-Wrapper -->
    <section id="content_wrapper">
        <!-- Begin: Content -->
        <section id="content" class="animated fadeIn">
            
            <h1>Forms 表单</h1>
            
            <div class="row center-block mt10">
                <div class="col-md-6">
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">基本实例</div>
                        </div>
                        <div class="as-panel-body">
                            <form role="form" id="text-form" class="as-form">
                                <div class="as-form-group">
                                    <label class="col-lg-3 as-control-label">Static Field</label>
                                    <div class="col-lg-8">
                                        <div class="bs-component">
                                            <p class="as-form-control-static text-muted">email@example.com</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="as-form-group">
                                    <label class="col-lg-3 as-control-label">Standard</label>
                                    <div class="col-lg-8">
                                        <div class="bs-component">
                                            <input type="text" name="Standard" class="form-control" title="Standard" data-options="required:true" />
                                        </div>
                                    </div>
                                </div>
                                <div class="as-form-group">
                                    <label class="col-lg-3 as-control-label">下拉菜单</label>
                                    <div class="col-lg-8">
                                        <div class="bs-component">
                                            <select class="form-control" name="select">
                                                <option>Option 1</option>
                                                <option>Option 2</option>
                                                <option>Option 3</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="as-form-group">
                                    <label class="col-lg-3 as-control-label">Disabled</label>
                                    <div class="col-lg-8">
                                        <div class="bs-component">
                                            <input type="text" name="Disabled" class="form-control" disabled/>
                                        </div>
                                    </div>
                                </div>
                                <div class="as-form-group">
                                    <label class="col-lg-3 as-control-label">Text Area Expand</label>
                                    <div class="col-lg-8">
                                        <div class="bs-component">
                                            <input type="text" name="Area" class="form-control" title="Text Area Expand" data-options="required:true" />
                                        </div>
                                    </div>
                                </div>
                                <div class="as-form-group">
                                    <label class="col-lg-3 as-control-label">Text Area</label>
                                    <div class="col-lg-8">
                                        <div class="bs-component">
                                            <textarea class="form-control" rows="3"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="as-form-group">
                                    <label class="col-lg-3 as-control-label">Disabled Text Area</label>
                                    <div class="col-lg-8">
                                        <div class="bs-component">
                                            <textarea class="form-control" rows="3" disabled></textarea>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="panel-footer text-right">
                            <button type="submit" id="btn-form" class="btn btn-primary ph25">提交</button>
                        </div>
                    </div>
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">校验状态</div>
                        </div>
                        <div class="as-panel-body">
                            <form role="form">
                                <div class="as-form-group has-primary">
                                    <label class="col-lg-3 as-control-label" for="inputPrimary">基本 Input</label>
                                    <div class="col-lg-8">
                                        <span class="as-append-icon right">
                                            <i class="fa fa-gear"></i>
                                        </span>
                                        <input type="text" class="form-control" id="inputPrimary">
                                    </div>
                                </div>
                                <div class="as-form-group has-success">
                                    <label class="col-lg-3 as-control-label" for="inputSuccess">成功 Input</label>
                                    <div class="col-lg-8">
                                        <span class="as-append-icon right">
                                            <i class="fa fa-check"></i>
                                        </span>
                                        <input type="text" class="form-control" id="inputSuccess">
                                    </div>
                                </div>
                                <div class="as-form-group has-info">
                                    <label class="col-lg-3 as-control-label" for="inputInfo">提示 Input</label>
                                    <div class="col-lg-8">
                                        <span class="as-append-icon right">
                                            <i class="fa fa-exclamation-circle"></i>
                                        </span>
                                        <input type="text" class="form-control" id="inputInfo">
                                    </div>
                                </div>
                                <div class="as-form-group has-warning">
                                    <label class="col-lg-3 as-control-label" for="inputWarning">警告 Input</label>
                                    <div class="col-lg-8">
                                        <span class="as-append-icon right">
                                            <i class="fa fa-exclamation-triangle"></i>
                                        </span>
                                        <input type="text" class="form-control" id="inputWarning">
                                    </div>
                                </div>
                                <div class="as-form-group has-error">
                                    <label class="col-lg-3 as-control-label" for="inputError">错误 Field</label>
                                    <div class="col-lg-8">
                                        <span class="as-append-icon right">
                                            <i class="fa fa-remove"></i>
                                        </span>
                                        <input type="text" class="form-control" id="inputError">
                                    </div>
                                </div>
                                <div class="as-form-group has-alert">
                                    <label class="col-lg-3 as-control-label" for="inputAlert">警示 Field</label>
                                    <div class="col-lg-8">
                                        <span class="as-append-icon right">
                                            <i class="fa fa-flag"></i>
                                        </span>
                                        <input type="text" class="form-control" id="inputAlert">
                                    </div>
                                </div>
                                <div class="as-form-group has-system">
                                    <label class="col-lg-3 as-control-label" for="inputSystem">系统消息 Input</label>
                                    <div class="col-lg-8">
                                        <span class="as-append-icon right">
                                            <i class="fa fa-bell"></i>
                                        </span>
                                        <input type="text" class="form-control" id="inputSystem">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">Combo</div>
                        </div>
                        <div class="as-panel-body p25 pb10">
                            <form>
                                <div class="as-form-group">
                                    <label class="col-md-3 as-control-label">Single Select</label>
                                    <div class="col-md-8">
                                        <select class="select2-single form-control" tabindex="-1" style="display: none;">
                                            <option value="CA">California</option>
                                            <option value="AL">Alabama</option>
                                            <option value="WY">Wyoming</option>
                                        </select>
                                        <span class="select2 select2-container select2-container--default select2-container--below" style="width: 488px;">
                                            <span class="selection">
                                                <span class="select2-selection select2-selection--single">
                                                    <span class="select2-selection__rendered" name="select2-7jnm-container" title="California">California</span>
                                                    <span class="select2-selection__arrow">
                                                        <b class="presentation"></b>
                                                    </span>
                                                </span>
                                            </span>
                                        </span>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">样式类</div>
                        </div>
                        <div class="as-panel-body">123</div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">默认 Checkboxes/Radios</div>
                        </div>
                        <div class="as-panel-body">123</div>
                    </div>
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">自定义Checkboxes</div>
                        </div>
                        <div class="as-panel-body">123</div>
                    </div>
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">自定义Radios</div>
                        </div>
                        <div class="as-panel-body">123</div>
                    </div>
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">自定义开关</div>
                        </div>
                        <div class="as-panel-body">123</div>
                    </div>
                    <div class="as-panel">
                        <div class="as-panel-header">
                            <div class="as-panel-title">提示信息</div>
                        </div>
                        <div class="as-panel-body">123</div>
                    </div>
                </div>
            </div>
        </section>
        <!-- End: Content -->
    </section>
    
    <!-- Combobox -->
    <span id="combo" class="select2-container select2-container--default select2-container--open" style="position: absolute; top: 269px; left: 1305.25px;">
        <span class="select2-dropdown select2-dropdown--below" style="width: 488px;">
            <span class="select2-search select2-search--dropdown">
                <input class="select2-search__field" type="search" tabindex="0" autocomplete="off" />
            </span>
            <span class="select2-results">
                <ul class="select2-results__options">
                    <li class="select2-results__option">California</li>
                    <li class="select2-results__option">Alabama</li>
                    <li class="select2-results__option select2-results__option--highlighted">Wyoming</li>
                </ul>
            </span>
        </span>
    </span>
    
	<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
	<script src="../js/bootstrap.min.js"></script>
    <script src="../js/admin.js"></script>
    <script>
        $(function(){
            Admin.init();
            
            $('span[name=select2-7jnm-container]').each(function(){
                $(this).click(function(){
                    
                    var a = $(this).offset();
                    
                    $('#combo').css('left',a.left - 1);
                    $('#combo').css('top',a.top + 37);
                });
            });
            
            
            $('#btn-form').click(function(e){
                $.parser.parse();
//                
//                var flag = $('#text-form').validatebox({
//                    url: '',
//                    width: 80
//                });
//                if(!flag){
//                    return false;
//                }
//                alert('提交成功');
            });
        });
        
        (function($){
            
            $.parser = {
        
                //是否自动解释
                auto: true,
                onComplete: function(_1) {},

                // 可以被解析的控件
                plugins: ["draggable", "droppable", "resizable", "pagination", "tooltip", "linkbutton", "menu", "menubutton", "splitbutton", "progressbar", "tree", "textbox", "filebox", "combo", "combobox", "combotree", "combogrid", "numberbox", "validatebox", "searchbox", "spinner", "numberspinner", "timespinner", "datetimespinner", "calendar", "datebox", "datetimebox", "slider", "layout", "panel", "datagrid", "propertygrid", "treegrid", "datalist", "tabs", "accordion", "window", "dialog", "form"],

                // 解析函数
                parse: function(_2) {
                    var aa = []; //需要easyLoader解析的组件数组
                    for (var i = 0; i < $.parser.plugins.length; i++) {
                        var _3 = $.parser.plugins[i]; // 控件名
                        var r = $(".as-" + _3, _2); // 查找class为easyui-控件名的jq对象，例如，easyui-layout
                        if (r.length) {

                            // 如果有这个对象，那么判断它有没有初始化函数
                            if (r[_3]) {

                                // 如果有直接调用
                                r[_3]();
                            }
                        }
                    }
                    
                    $.parser.onComplete.call($.parser, _2);
                }
            };
            
//            function _34(_35, _36) {
//                _36 = _36 || {};
//                var _37 = $.data(_35, "form");
//                if (_37) {
//                    $.extend(_37.options, _36);
//                } else {
//                    $.data(_35, "form", {
//                        options: $.extend({},
//                        $.fn.form.defaults, $.fn.form.parseOptions(_35), _36)
//                    });
//                }
//            };
            
            $.fn.validatebox = function(_3e, _3f){
//                opt = opt || {};
//                var flag = false;
                
                if (typeof _3e == "string") {
                    this.each(function() {
                        _34(this);
                    });
                    return $.fn.form.methods[_3e](this, _3f);
                }
                return this.each(function() {
                    _34(this, _3e);
                    _30(this);
                });
                
//                this.each(function(){
//                    var row = $(this);
//                    
//                    var r = row.length>0?row[0]:r;
//                    
//                    for(var i=0;i<r.length;i++){
//                        var options = $(r[i]).data('options');
//                        var val = $(r[i]).val();
//                        var name = $(r[i]).attr('title');
//                        
//                        if(options != undefined && options != ''){
//                            var s = $.trim(options);
//                            
//                            if (s.substring(0, 1) != "{") {
//                                s = "{" + s + "}";
//                            }
//                            _d = (new Function("return " + s))();
//
//                            if(_d.hasOwnProperty('required')){
//                                required = _d.required || false;
//
//                                if(val == '' && required){
//                                    alert('请填写' + name);
//                                    flag = false;
//                                    break;
//                                }else{
//                                    flag = true;
//                                }
//                            }
//                        }
//                    }
//                });
                
//                return flag;
            }
        })(jQuery);
    </script>
</body>
</html>